﻿using com.fukefu.source;
using com.fukefu.spider;

namespace com.fukefu.update
{
    public abstract class UpdateData
    {
        //委托
        public event MyDelegate3 SetControl;
        public event MyDelegate1_1 _SetMaxNum;
        public event MyDelegate0 _SetNumAdd;
        //需要的函数
        protected Source source = new Source();
        protected Spider baidu = new BaiduSpider();
        protected MultiThread mt = new MultiThread();

        public abstract string GetTitle();
        public abstract void Start();
        //显示信息
        protected void Display(string message)
        {
            SetControl("listbox1", ControlValue.ListBox, message);
        }
        protected void SetButton(bool b)
        {
            SetControl("StartButton", ControlValue.Enable, b);
        }
        protected void SetMaxNum(int i)
        {
            if (_SetMaxNum != null)
            {
                _SetMaxNum(i);
            }
        }
        protected void SetNumAdd()
        {
            if (_SetNumAdd != null)
            {
                _SetNumAdd();
            }
        }
    }
}
